package com.explorer.ider.bootguide.views;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.SurfaceView;

/**
 * Created by Eric on 2016/9/5.
 */
public class ClockView extends SurfaceView {
    private int hourTime;
    private int minute;
    private Paint paint;

    public ClockView(Context context, AttributeSet attrs) {
        super(context, attrs);

    }



    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        paint.setAntiAlias(true);                       //设置画笔为无锯齿
        paint.setColor(Color.BLACK);                    //设置画笔颜色
        canvas.drawColor(Color.WHITE);                  //白色背景
        paint.setStrokeWidth((float) 3.0);              //线宽
        paint.setStyle(Paint.Style.STROKE);
        RectF r2=new RectF();                           //RectF对象
        r2.left=50;                                 //左边
        r2.top=400;                                 //上边
        r2.right=450;                                   //右边
        r2.bottom=600;                              //下边
        canvas.drawRoundRect(r2, 10, 10, paint);
    }
}
